* Data downloaded from https://www.europeansocialsurvey.org/
* Wave 7 (2014) 
use "Data\ESS7e02_2.dta\ESS7e02_2.dta"


keep if cntry == "GB"
tab imsmetn
recode imsmetn (1/2=1) (3/4=0) (7/8=.), gen (allow_samerace)
mean allow_samerace [pweight = dweight]

tab imdfetn
recode imdfetn (1/2=1) (3/4=0) (7/8=.), gen (allow_diffrace)
mean allow_diffrace [pweight = dweight]

tab eimpcnt
recode eimpcnt (1/2=1) (3/4=0) (7/8=.), gen (allow_poorereur)
mean allow_poorereur [pweight = dweight]

tab impcntr
recode impcntr (1/2=1) (3/4=0) (7/8=.), gen (allow_poorernoneur)
mean allow_poorernoneur [pweight = dweight]

tab almuslv
recode almuslv (1/2=1) (3/4=0) (7/8=.), gen (allow_muslims)
mean allow_muslims [pweight = dweight]

tab algyplv
recode algyplv (1/2=1) (3/4=0) (7/8=.), gen (allow_gypsies)
mean allow_gypsies [pweight = dweight]


tab blgetmg
recode blgetmg (7/8=.)
mean allow_samerace [pweight = dweight] if blgetmg == 2 & brncntr == 1
mean allow_poorereur [pweight = dweight] if blgetmg == 2 & brncntr == 1
mean allow_diffrace [pweight = dweight] if blgetmg == 2 & brncntr == 1
mean allow_poorernoneur [pweight = dweight] if blgetmg == 2 & brncntr == 1
mean allow_muslims [pweight = dweight] if blgetmg == 2 & brncntr == 1
mean allow_gypsies [pweight = dweight] if blgetmg == 2 & brncntr == 1

* Significance tests
ttest allow_samerace == allow_poorereur if blgetmg == 2 & brncntr == 1
ttest allow_samerace == allow_diffrace if blgetmg == 2 & brncntr == 1
ttest allow_samerace == allow_poorernoneur if blgetmg == 2 & brncntr == 1
ttest allow_samerace == allow_muslims if blgetmg == 2 & brncntr == 1
ttest allow_samerace == allow_gypsies if blgetmg == 2 & brncntr == 1
